Optimal. Leaf size=103 \[ -\frac {2 a b \cos ^5(c+d x)}{5 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^5(c+d x)}{5 d}-\frac {b^2 \sin ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 103, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3169, 2713,
2645, 30, 2644, 14} \begin {gather*} \frac {a^2 \sin ^5(c+d x)}{5 d}-\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {2 a b \cos ^5(c+d x)}{5 d}-\frac {b^2 \sin ^5(c+d x)}{5 d}+\frac {b^2 \sin ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 30
Rule 2644
Rule 2645
Rule 2713
Rule 3169
Rubi steps
\begin {align*} \int \cos ^3(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx &=\int \left (a^2 \cos ^5(c+d x)+2 a b \cos ^4(c+d x) \sin (c+d x)+b^2 \cos ^3(c+d x) \sin ^2(c+d x)\right ) \, dx\\ &=a^2 \int \cos ^5(c+d x) \, dx+(2 a b) \int \cos ^4(c+d x) \sin (c+d x) \, dx+b^2 \int \cos ^3(c+d x) \sin ^2(c+d x) \, dx\\ &=-\frac {a^2 \text {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac {(2 a b) \text {Subst}\left (\int x^4 \, dx,x,\cos (c+d x)\right )}{d}+\frac {b^2 \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {2 a b \cos ^5(c+d x)}{5 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^5(c+d x)}{5 d}+\frac {b^2 \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {2 a b \cos ^5(c+d x)}{5 d}+\frac {a^2 \sin (c+d x)}{d}-\frac {2 a^2 \sin ^3(c+d x)}{3 d}+\frac {b^2 \sin ^3(c+d x)}{3 d}+\frac {a^2 \sin ^5(c+d x)}{5 d}-\frac {b^2 \sin ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.19, size = 116, normalized size = 1.13 \begin {gather*} \frac {-60 a b \cos (c+d x)-30 a b \cos (3 (c+d x))-6 a b \cos (5 (c+d x))+150 a^2 \sin (c+d x)+30 b^2 \sin (c+d x)+25 a^2 \sin (3 (c+d x))-5 b^2 \sin (3 (c+d x))+3 a^2 \sin (5 (c+d x))-3 b^2 \sin (5 (c+d x))}{240 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 88, normalized size = 0.85
method | result | size |
derivativedivides | \(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )-\frac {2 a b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {a^{2} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}}{d}\) | \(88\) |
default | \(\frac {b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )-\frac {2 a b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {a^{2} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}}{d}\) | \(88\) |
risch | \(-\frac {a b \cos \left (d x +c \right )}{4 d}+\frac {5 a^{2} \sin \left (d x +c \right )}{8 d}+\frac {b^{2} \sin \left (d x +c \right )}{8 d}-\frac {a b \cos \left (5 d x +5 c \right )}{40 d}+\frac {\sin \left (5 d x +5 c \right ) a^{2}}{80 d}-\frac {\sin \left (5 d x +5 c \right ) b^{2}}{80 d}-\frac {a b \cos \left (3 d x +3 c \right )}{8 d}+\frac {5 \sin \left (3 d x +3 c \right ) a^{2}}{48 d}-\frac {\sin \left (3 d x +3 c \right ) b^{2}}{48 d}\) | \(143\) |
norman | \(\frac {-\frac {4 a b}{5 d}+\frac {2 a^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{2} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {8 \left (a^{2}+b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 \left (a^{2}+b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {4 \left (29 a^{2}-4 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}-\frac {8 a b \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 a b \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(170\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 77, normalized size = 0.75 \begin {gather*} -\frac {6 \, a b \cos \left (d x + c\right )^{5} - {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a^{2} + {\left (3 \, \sin \left (d x + c\right )^{5} - 5 \, \sin \left (d x + c\right )^{3}\right )} b^{2}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.23, size = 74, normalized size = 0.72 \begin {gather*} -\frac {6 \, a b \cos \left (d x + c\right )^{5} - {\left (3 \, {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} + {\left (4 \, a^{2} + b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, a^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.29, size = 138, normalized size = 1.34 \begin {gather*} \begin {cases} \frac {8 a^{2} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 a^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {a^{2} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} - \frac {2 a b \cos ^{5}{\left (c + d x \right )}}{5 d} + \frac {2 b^{2} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{2} \cos ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.43, size = 114, normalized size = 1.11 \begin {gather*} -\frac {a b \cos \left (5 \, d x + 5 \, c\right )}{40 \, d} - \frac {a b \cos \left (3 \, d x + 3 \, c\right )}{8 \, d} - \frac {a b \cos \left (d x + c\right )}{4 \, d} + \frac {{\left (a^{2} - b^{2}\right )} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {{\left (5 \, a^{2} - b^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (5 \, a^{2} + b^{2}\right )} \sin \left (d x + c\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.61, size = 115, normalized size = 1.12 \begin {gather*} \frac {2\,\left (\frac {3\,\sin \left (c+d\,x\right )\,a^2\,{\cos \left (c+d\,x\right )}^4}{2}+2\,\sin \left (c+d\,x\right )\,a^2\,{\cos \left (c+d\,x\right )}^2+4\,\sin \left (c+d\,x\right )\,a^2-3\,a\,b\,{\cos \left (c+d\,x\right )}^5-\frac {3\,\sin \left (c+d\,x\right )\,b^2\,{\cos \left (c+d\,x\right )}^4}{2}+\frac {\sin \left (c+d\,x\right )\,b^2\,{\cos \left (c+d\,x\right )}^2}{2}+\sin \left (c+d\,x\right )\,b^2\right )}{15\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________